package model.bean;

import static org.junit.Assert.*;

import it.mrcrack.exception.DataFormatException;

import java.util.GregorianCalendar;

import org.junit.Test;

public class ReportTest {

	@Test
	public void testReport() {
		System.out.println("Testo il costruttore senza parametri");
		Report r=new Report();
		assertEquals(r.getData(),null);
	}

	@Test
	public void testGetSetData() {
		System.out.println("Testo setData() e getData()");
		Report r=new Report();
		GregorianCalendar gc=new GregorianCalendar();
		try {
			r.setData(gc);
		} catch (DataFormatException e) {
			fail(e.getMessage());
		}
		assertNotSame(r.getData(),gc);
		assertTrue(r.getData().equals(gc));
	}

	@Test
	public void testImpostatoTrue() {
		System.out.println("Testo impostato()");
		Report r=new Report();
		assertFalse(r.impostato());
		GregorianCalendar gc=new GregorianCalendar();
		try {
			r.setData(gc);
		} catch (DataFormatException e) {
			fail(e.getMessage());
		}
		assertTrue(r.impostato());
	}
}